<template>
	<view class="">
		<news-list :list="newList" @itemClick="goDetail"></news-list>
	</view>
	
</template>

<script>
	import newslist from '@/pages/components/news_list.vue'
	export default {
		data() {
			return {
				newList:[]
				
			}
		},
		components:{
			"news-list":newslist,
		},
		onLoad() {
			this.getNewlist()
		},
		methods: {
			async getNewlist(){
				const res =await this.$myRequest({
					url:'/api/getnewslist'
				})
				this.newList = res.data.message
				
			},
			goDetail(id){
				
				uni.navigateTo({
					url:"/pages/detail/detail?id="+id
				})
			}
			
		}
	}
</script>

<style lang="scss">
	
</style>
